package cn.yj.email.handle;

import cn.yj.email.executor.EmailExecutor;
import org.springframework.mail.javamail.JavaMailSender;

/**
 * <p>
 *
 * </p>
 *
 * @author 永健
 * @since 2019-06-01 13:58
 */
public abstract class AbstractEmailHandler implements EmailHandler
{

    protected abstract JavaMailSender mailSender();

    @Override
    public void sendEmail(Email email)
    {
        executor().send(setEmail(email));
    }
    protected abstract EmailExecutor executor();
    protected abstract Email setEmail(Email email);
}
